<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAdminsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admins', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('staff_id')->default(0)->unique()->comment('管理员编号');
            $table->string('password', 191)->default('')->comment('密码');
            $table->string('name', 32)->default('')->comment('名字');
            $table->string('nickname', 32)->default('')->comment('昵称');
            $table->string('avatar')->default('')->comment('头像');
            $table->string('tel', 20)->default('')->comment('电话');
            $table->string('email')->default('')->comment('邮箱');
            $table->boolean('enable')->default(1)->comment('启用状态');
            $table->rememberToken();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admins');
    }
}
